package com.springmvc.service;

import com.springmvc.dao.wenzhangMapper;
import com.springmvc.entity.leibie;
import com.springmvc.entity.wenzhang;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional(rollbackFor = Exception.class)
@Service("articleService")
public class ArticleService {

    @Autowired
    private com.springmvc.dao.wenzhangMapper wenzhangMapper;

    public List<wenzhang> getListByPage(wenzhang wenzhang) {
        return wenzhangMapper.getListByPage(wenzhang);
    }

    public Long getCount(wenzhang wenzhang) {
        return wenzhangMapper.getCount(wenzhang);
    }
    public int updateByPrimaryKey(wenzhang wenzhang){
        return wenzhangMapper.updateByPrimaryKey(wenzhang);
    }
    public void insert(wenzhang wenzhang) {
        wenzhangMapper.insert(wenzhang);
    }

    public void update(wenzhang wenzhang) {
        wenzhangMapper.updateByPrimaryKeySelective(wenzhang);
    }
    public  int deleteByPrimaryKey(Integer id){
       return wenzhangMapper.deleteByPrimaryKey(id);
    }

    public wenzhang getByPrimaryId(Integer id) {
        return wenzhangMapper.selectByPrimaryKey(id);
    }

    public List<leibie> getArticleGroup() {
        return wenzhangMapper.getArticleGroup();
    }
}
